<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    
    <h:head>
        <title>Login</title>
        <h:outputStylesheet name="common-style.css" library="css" />
        <h:outputStylesheet name="styles.css"/>
        <h:outputScript name="jquery-1.11.1.js" target="head"/>
        <h:outputScript name="loginScript.js" target="head"/>
    </h:head>
    <h:body style="width: 100%">
        
        <h:form id="loginForm" class="formall">
            <p:remoteCommand autoRun="true" actionListener="#{loginBean.checkAlreadyLogged()}" />
            <div id="logoBox"/>
            <h:panelGrid columns="1" class="loginPanel1" >
                <h:inputText id="inputEmail" class="inputStyle" value="#{loginBean.email}"/>
                    <h:message id="emailMsg" for="inputEmail" class="errorMessage"  />
            </h:panelGrid>
            <h:panelGrid columns="1" class="loginPanel2">
                <h:inputSecret id="inputPassword" class="inputStyle" value="#{loginBean.password}"/>
                    <h:message id="passwordMsg" for="inputPassword" class="errorMessage" />
            </h:panelGrid>
                <h:outputLabel id="labelEmail" class="labelEmailLog" value="Email"/>
                <h:outputLabel id="labelPassword" class="labelPasswordLog" value="Password"/>
            <h:commandButton class="buttonLoginStyle" value="Login" 
                             action="#{loginBean.login()}"/>
            <h:link outcome="registration.xhtml" value="Register" class="linkStyle"/>
        </h:form>
        <h:messages id="loginMsg" layout="table" class="errorMessage" />

    </h:body>
</html>

